package com.txq.bilibili.app.model;

import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by yun on 2015/3/24.
 */
public class RecommendContent {
    private int id;
    private int type;
    private String decription;
    private long nReplies;
    private long onLineCnt;
    private long lastUpdateTime;
    private String title;
    private String picUrl;
    private int showInList;
    private int attention;
    private long nAllReplies;
    private int detailSort;
    private String contentWithoutPics;

    public String getContentWithoutPics() {
        return contentWithoutPics;
    }

    public void setContentWithoutPics(String contentWithoutPics) {
        this.contentWithoutPics = contentWithoutPics;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDecription() {
        return decription;
    }

    public void setDecription(String decription) {
        this.decription = decription;
    }

    public long getnReplies() {
        return nReplies;
    }

    public void setnReplies(long nReplies) {
        this.nReplies = nReplies;
    }

    public long getOnLineCnt() {
        return onLineCnt;
    }

    public void setOnLineCnt(long onLineCnt) {
        this.onLineCnt = onLineCnt;
    }

    public long getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(long lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPicUrl() {
        return picUrl;
    }

    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }

    public int getShowInList() {
        return showInList;
    }

    public void setShowInList(int showInList) {
        this.showInList = showInList;
    }

    public int getAttention() {
        return attention;
    }

    public void setAttention(int attention) {
        this.attention = attention;
    }

    public long getnAllReplies() {
        return nAllReplies;
    }

    public void setnAllReplies(long nAllReplies) {
        this.nAllReplies = nAllReplies;
    }

    public int getDetailSort() {
        return detailSort;
    }

    public void setDetailSort(int detailSort) {
        this.detailSort = detailSort;
    }

    public void parseJson(JSONObject object){

        try {
            id=object.getInt("id");
            type=object.getInt("type");
            decription=object.getString("description");
            Log.d(".recommend...description",decription);
            nReplies=object.getLong("nReplies");
            onLineCnt=object.getLong("onlineCnt");
            lastUpdateTime=object.getLong("lastUpdateTime");
            title=object.getString("title");
            picUrl=object.getString("picUrl");
            attention = object.getInt("attention");
            nAllReplies=object.getLong("nAllReplies");
            detailSort=object.getInt("detailSort");

            JSONObject newest=object.getJSONObject("newest");
            contentWithoutPics=newest.getString("content_without_pics");
        } catch (JSONException e) {
            e.printStackTrace();
        }


    }
}
